<template>
	<view class="choose_hos-content-box">
		<view class="header-box">
			<view :class="isEdit?'w80 search-box':'search-box'">
				<image class="search-img" src="../../static/icon_search.png" mode="aspectFill"></image>
				<input :focus="isEdit" @focus="searchFocus" @blur="searchBlur" class="search-input" type="text" placeholder="若无医院信息,请输入所在医院信息查找" />
			</view>
			<view class="cancel" v-if="isEdit" @click="cancelSearchClick">
				取消
			</view>
		</view>
		
		<view class="item-box">
			<view class="item" v-for="item in 20">
				我是医院名称我是医院名称我是医院名称我是医院名称我是医院名称我是医院名称
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isEdit: false // 是否在输入
			};
		},
		methods: {
			searchBlur(){
				// this.isEdit = false;
			},
			searchFocus(){
				this.isEdit = true;
			},
			cancelSearchClick(){
				this.isEdit = false;
			}
		}
	}
</script>

<style lang="less" scoped>
	view{
		box-sizing: border-box;
	}
	.choose_hos-content-box{
		min-height: 100%;
		background-color: #FFFFFF;
		padding-top: 100rpx;
		.header-box{
			width: 100%;
			position: fixed;
			top: 0rpx;
			display: flex;
			justify-content: center;
			align-items: center;
		}
		.cancel{
			margin-left: 10rpx;
			color: #0098f2;
		}
		
		.search-box{
			width: 90%;
			height: 80rpx;
			background-color: #eaeefb;
			display: flex;
			align-items: center;
			border-radius: 40rpx;
			padding-left: 10rpx;
			padding-right: 20rpx;
			.search-img{
				width: 50rpx;
				height: 50rpx;
			}
			.search-input{
				flex: 1;
				margin-left: 10rpx;
				font-size: 26rpx;
				color: #323233;
			}
		}
		.w80{
			width: 80%;
		}
		.item-box{
			position: absolute;
			top: 100rpx;
			bottom: 0rpx;
			left: 0rpx;
			right: 0rpx;
			overflow-y: scroll;
			background-color: #FFFFFF;
			.item{
				width: 100%;
				padding: 10rpx 20rpx;
				border-bottom: solid 1rpx #eaeefb;
			}
		}
		
	}
</style>
